/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package neo.workforce.dao.impl;

import java.sql.ResultSet;
import java.sql.SQLException;
import neo.workforce.dao.Transaction;
import org.springframework.jdbc.core.RowMapper;

/**
 *
 * @author KTB_User
 */
public class TransactionRowMapper implements RowMapper {

    public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        Transaction item = new Transaction();
        item.setId(rs.getInt("ID"));
        item.setUserId(rs.getLong("USER_ID"));
        item.setProcessId(rs.getLong("PROCESS_ID"));
        item.setActivityId(rs.getLong("ACTIVITY_ID"));
        item.setSessionId(rs.getString("SESSION_ID"));
        item.setInState(rs.getString("IN_STATE"));
        item.setOutState(rs.getString("OUT_STATE"));
        item.setStateType(rs.getString("STATE_TYPE"));
        item.setCreateDate(new java.sql.Date(rs.getDate("CREATE_DATE").getTime()));
        item.setUpdateDate(new java.sql.Date(rs.getDate("UPDATE_DATE").getTime()));
        return item;
    }
}
